import network.MqttService
import org.junit.jupiter.api.Assertions
import org.junit.jupiter.api.Test

class MqttTest {

    val mqtt = MqttService()

    @Test fun connect() {
        Assertions.assertTrue(mqtt.connect())
    }

    @Test fun subscribe() {
        val topicList = listOf("eig/query_", "eig/command_", "eig/test_")
        mqtt.subscribe(topicList)
    }

    @Test fun publish() {
        val message = "{\"a\": 123}"
        mqtt.publish("eigxxx/query_/aaaa", message)
    }
}